package com.taobao.api.request;

import com.taobao.api.internal.util.RequestCheckUtils;
import java.util.Map;
import java.util.HashMap;

import com.taobao.api.ApiRuleException;
import com.taobao.api.BaseTaobaoRequest;
import com.taobao.api.FileItem;
import com.taobao.api.TaobaoUploadRequest;
import com.taobao.api.internal.util.TaobaoHashMap;

import com.taobao.api.response.TmallExchangeAgreeResponse;

/**
 * TOP API: tmall.exchange.agree request
 * 
 * @author top auto create
 * @since 1.0, 2018.08.09
 */
public class TmallExchangeAgreeRequest extends BaseTaobaoRequest<TmallExchangeAgreeResponse> implements TaobaoUploadRequest<TmallExchangeAgreeResponse> {

	
	

	/** 
	* 收货地址id，如需获取请调用该top接口：taobao.logistics.address.search，对应属性为contact_id
	 */
	private Long addressId;

	/** 
	* 详细收货地址
	 */
	private String completeAddress;

	/** 
	* 换货单号ID
	 */
	private Long disputeId;

	/** 
	* 返回字段。当前支持的有 dispute_id, bizorder_id, modified, status
	 */
	private String fields;

	/** 
	* 卖家留言
	 */
	private String leaveMessage;

	/** 
	* 上传图片举证
	 */
	private FileItem leaveMessagePics;

	/** 
	* 收货人手机号
	 */
	private String mobile;

	/** 
	* 邮政编码
	 */
	private String post;

	public void setAddressId(Long addressId) {
		this.addressId = addressId;
	}

	public Long getAddressId() {
		return this.addressId;
	}

	public void setCompleteAddress(String completeAddress) {
		this.completeAddress = completeAddress;
	}

	public String getCompleteAddress() {
		return this.completeAddress;
	}

	public void setDisputeId(Long disputeId) {
		this.disputeId = disputeId;
	}

	public Long getDisputeId() {
		return this.disputeId;
	}

	public void setFields(String fields) {
		this.fields = fields;
	}

	public String getFields() {
		return this.fields;
	}

	public void setLeaveMessage(String leaveMessage) {
		this.leaveMessage = leaveMessage;
	}

	public String getLeaveMessage() {
		return this.leaveMessage;
	}

	public void setLeaveMessagePics(FileItem leaveMessagePics) {
		this.leaveMessagePics = leaveMessagePics;
	}

	public FileItem getLeaveMessagePics() {
		return this.leaveMessagePics;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getMobile() {
		return this.mobile;
	}

	public void setPost(String post) {
		this.post = post;
	}

	public String getPost() {
		return this.post;
	}

	public String getApiMethodName() {
		return "tmall.exchange.agree";
	}

	public Map<String, String> getTextParams() {
		TaobaoHashMap txtParams = new TaobaoHashMap();
		txtParams.put("address_id", this.addressId);
		txtParams.put("complete_address", this.completeAddress);
		txtParams.put("dispute_id", this.disputeId);
		txtParams.put("fields", this.fields);
		txtParams.put("leave_message", this.leaveMessage);
		txtParams.put("mobile", this.mobile);
		txtParams.put("post", this.post);
		if(this.udfParams != null) {
			txtParams.putAll(this.udfParams);
		}
		return txtParams;
	}

	public Class<TmallExchangeAgreeResponse> getResponseClass() {
		return TmallExchangeAgreeResponse.class;
	}

	public void check() throws ApiRuleException {
		
		RequestCheckUtils.checkNotEmpty(addressId, "addressId");
		RequestCheckUtils.checkNotEmpty(disputeId, "disputeId");
		RequestCheckUtils.checkNotEmpty(fields, "fields");
		RequestCheckUtils.checkMaxListSize(fields, 20, "fields");
	}

	public Map<String, FileItem> getFileParams() {
		Map<String, FileItem> params = new HashMap<String, FileItem>();
		params.put("leave_message_pics", this.leaveMessagePics);
		return params;
	}
	
	

}